<?php
include('chksession.php');
include('conn.php');
session_start();
   
$id = $_REQUEST['id'];
$remarks= $_REQUEST['remarks'];
$da = $_REQUEST['debitamt'];
$ca = $_REQUEST['cr'];
$branch = $_REQUEST['branch'];
$dt = $_REQUEST['trndate'];
$tdate = date("Y-m-d", strtotime($dt));
$netrate = $_REQUEST['netrate'];
$bank = $_REQUEST['bank'];
$IDNumber = $_REQUEST['IDNumber'];
$dname = $_REQUEST['dname'];

// echo "date is ".$tdate."<br>";
$sql= "update transactionmast set IDNumber='".$IDNumber."',remarks='".$remarks."',debitamt='".$da."',creditamt='".$ca."',netrate='".$netrate."',branchname='".$branch."' 
where trnid=".$id;

// echo $sql;
// return;

$res=mysql_query($sql);
if (!$res) 
  echo('invalid query: ' . mysql_error());

// $sql3= "select bankid from bankmast as b where '".$bank."'=b.bankname";
// $res3=mysql_query($sql3);
// while ($row = mysql_fetch_assoc($res3))     
    // $bnkid = $row["bankid"];    
// /*if(!res3)
// {
	// $stmt1= "select bankid from bankmast";
	// $res4=mysql_query($stmt1);
	// while ($row = mysql_fetch_assoc($res4)) 
		// $newid = $row["bankid"]; 
	// $newid=$newid+1;
	// $ins=mysql_query("insert into bankmast(bankid,bankname) values '".$newid."','".$bank".';");
	// echo "inserted".$ins;
// }*/

// $sql2= "update transactionmast set bankid='".$bnkid."'where trnid=".$id ;
// $res2=mysql_query($sql2);
// echo $sql2;
// if (!$res2) 
    // echo('Invalid query: ' . mysql_error());
?>